from multiprocessing import Process

class MyProcess(Process):

    def __init__(self,name):
        super().__init__()
        self.name = name
    def run(self):#必须重写run方法
        n = 1
        while True:
            n+=1
            print("进程的名字：{}---------------->我是自定义进程，n:{}".format(self.name,n))
if __name__ == '__main__':
    p = MyProcess("x")
    p.start()
    p1 = MyProcess("y")
    p1.start()